import os

path = '/Users/txy/Desktop/项目'
files = os.listdir(path)
files.sort()

with open('filename.txt','w') as f:
	for file in files:
	    print(file)
	    f.write(file+'\n')
